// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import {
    AddNoticeInput,
    DeleteNoticeInput,
    NoticeInput,
    PageNoticeInput,
    UpdateNoticeInput,
} from '../models';
// 定义 API 路径枚举
enum Api {
    SysNoticeAdd = '/sysNotice/add',
    SysNoticeDelete = '/sysNotice/delete',
    SysNoticePage = '/sysNotice/page',
    SysNoticePageReceived = '/sysNotice/pageReceived',
    SysNoticePublic = '/sysNotice/public',
    SysNoticeSetRead = '/sysNotice/setRead',
    SysNoticeUnReadList = '/sysNotice/unReadList',
    SysNoticeUpdate = '/sysNotice/update',
}

// 定义 API 方法
export const apiSysNoticeAddPost = (body?: AddNoticeInput) =>
    request({
        url: Api.SysNoticeAdd,
        method: 'post',
        data: body,
    });

export const apiSysNoticeDeletePost = (body?: DeleteNoticeInput) =>
    request({
        url: Api.SysNoticeDelete,
        method: 'post',
        data: body,
    });

export const apiSysNoticePagePost = (body?: PageNoticeInput) =>
    request({
        url: Api.SysNoticePage,
        method: 'post',
        data: body,
    });

export const apiSysNoticePageReceivedPost = (body?: PageNoticeInput) =>
    request({
        url: Api.SysNoticePageReceived,
        method: 'post',
        data: body,
    });

export const apiSysNoticePublicPost = (body?: NoticeInput) =>
    request({
        url: Api.SysNoticePublic,
        method: 'post',
        data: body,
    });

export const apiSysNoticeSetReadPost = (body?: NoticeInput) =>
    request({
        url: Api.SysNoticeSetRead,
        method: 'post',
        data: body,
    });

export const apiSysNoticeUnReadListGet = () =>
    request({
        url: Api.SysNoticeUnReadList,
        method: 'get',
    });

export const apiSysNoticeUpdatePost = (body?: UpdateNoticeInput) =>
    request({
        url: Api.SysNoticeUpdate,
        method: 'post',
        data: body,
    });